package com.local.web.service;

import com.local.common.util.PageResultUtil;
import com.local.common.util.ResultUtil;
import com.local.goods.pojo.Goods;
import com.local.goods.pojo.GoodsESDoc;
import com.local.goods.pojo.GoodsESRequestParam;

import java.util.List;

public interface GoodsService {

    /**
     * 根据id查询goods
     * @param id
     * @return
     */
    public Goods getById(Integer id);

    /**
     * 通过关键词keywords对goods进行es搜索
     * @param param
     * @return
     */
    public ResultUtil<PageResultUtil<GoodsESDoc>> search(GoodsESRequestParam param);

    /**
     * 搜索的自动补齐，即搜索建议
     * @param keywords
     * @return
     */
    public ResultUtil<List<String>> searchSuggestion(String keywords);
}
